How Automatic Visual Inspection Works